package com.example.design.dahua.strategy.new4strategyandfactory;


/**
 * @author ebnew
 * 折扣收费类
 */
public class CashRebate extends AbstractCash {

    private double rebate;

    /**
     * @param rebate 折扣率
     * 初始化的时候由构造函数传入
     */
    public CashRebate(double rebate){
        this.rebate=rebate;
    }

    @Override
    public double acceptCash(double money) {
        return money*rebate;
    }
}
